Cytosim  PI
Cytoskeleton Simulator
RigidFiber Class Reference

Detailed Description

Implements the methods of a Mecable for the FiberNaked:

  1. setSpeedsFromForces() includes longitudinal incompressibility, which means keeping successive points equidistants: norm( point(p+1) - point(p) ) = segmentation()
  2. addRigidity() implements bending elasticity.
Inheritance diagram for RigidFiber:
FiberNaked PointSet Mecable Object Buddy Node Inventoried Movable Fiber ClassicFiber DynamicFiber TreadmillingFiber Tubule

Public Member Functions

 RigidFiber ()
 Constructor.
 
 RigidFiber (RigidFiber const &)
 copy constructor
 
RigidFiberoperator= (RigidFiber const &)
 copy assignment
 
virtual ~RigidFiber ()
 Destructor.
 
virtual unsigned allocatePoints (unsigned nbp)
 sets the number of points in the Fiber
 
real lagrange (unsigned p) const
 Lagrange multiplier for segment p.
 
real tension (unsigned p) const
 longitudinal force along segment p (positive=extension, negative=compression)
 
real dragCoefficient () const
 total drag-coefficient of object (force = drag * speed)
 
real pointMobility () const
 mobility of one point
 
void makeProjection ()
 prepare for projection
 
void projectForces (const real *X, real *Y, real s, real *work) const
 apply the projection: Y <- s * P * X More...
 
void makeProjectionDiff (const real *)
 prepare the correction to the projection
 
void addProjectionDiff (const real *, real *) const
 add the contribution from the projection correction
 
real addBrownianForces (real *rhs, real sc) const
 add displacements due to the Brownian motion to rhs[] More...
 
void setSpeedsFromForces (const real *X, real *Y, real, bool) const
 calculate the speeds from the forces, including projection More...
 
void addRigidity (const real *X, real *Y) const
 add the rigidity force corresponding to configuration X into vector Y More...
 
void addRigidityMatUp (Matrix &, int offset) const
 add rigidity terms into the matrix
 
- Public Member Functions inherited from FiberNaked
 FiberNaked ()
 Constructor.
 
 ~FiberNaked ()
 Destructor.
 
void setStraight (Vector const &pos, Vector const &dir)
 set position of MINUS_END and direction (length and Nb of points are not modified) More...
 
void setStraight (Vector const &pos, Vector const &dir, FiberEnd ref)
 set position of 'ref' and direction of Fiber
 
void setStraight (Vector const &pos, Vector const &dir, real len, FiberEnd ref)
 set position of 'ref', direction and length of Fiber
 
void setShape (const real pts[], unsigned n_pts, unsigned np)
 import shape from the given array of size DIM*n_pts, and create a shape with np points More...
 
PointExact exactEnd (FiberEnd) const
 exact representation of given end
 
PointInterpolated interpolateEnd (FiberEnd) const
 interpolation representing a given end (CENTER is also a valid argument)
 
PointInterpolated interpolateCenter () const
 interpolation representing a given end
 
PointInterpolated interpolateMinusEnd () const
 interpolation representing the MINUS_END
 
PointInterpolated interpolatePlusEnd () const
 interpolation representing the PLUS_END
 
PointInterpolated interpolate (real ab) const
 interpolation of the site specified by its distance from the ORIGIN More...
 
PointInterpolated interpolateM (real ab) const
 interpolation of the site specified from the MINUS_END More...
 
PointInterpolated interpolate (real ab, FiberEnd from) const
 interpolation of a site specified by its distance from a FiberEnd
 
real abscissaM () const
 signed distance from ORIGIN to MINUS_END (abscissa of MINUS_END)
 
real abscissaP () const
 signed distance from ORIGIN to PLUS_END (abscissa of PLUS_END)
 
real abscissaP (const real n) const
 signed distance from ORIGIN to given point or intermediate position
 
real abscissa (FiberEnd end) const
 signed distance from the ORIGIN to the specified FiberEnd More...
 
real abscissa (real ab, FiberEnd from) const
 converts abscissa from the specified FiberEnd, to abscissa from the ORIGIN More...
 
real length () const
 the total length of the Fiber
 
bool within (const real ab) const
 true if ( abscissaM() < ab < abscissaP() )
 
bool withinP (const real ab) const
 true if abscissa is below abscissaP
 
bool withinM (const real ab) const
 true if abscissa is above abscissaM
 
unsigned int signature () const
 a random number which is used in speckle display
 
void signature (unsigned int s)
 set signature
 
FiberEnd whichEndDomain (real ab, real lambda) const
 calculate the domain in which ab is located (near a FiberEnd, or central) More...
 
Vector pos (real ab) const
 position of a point specified by abscissa from the origin
 
Vector posM (real ab) const
 position of a point specified by abscissa from the MINUS_END
 
Vector pos (real ab, FiberEnd from) const
 position of a point specified by abscissa on the Fiber
 
Vector posEnd (FiberEnd which) const
 position of a FiberEnd (CENTER is also a valid argument)
 
Vector dirP (unsigned p) const
 normalized tangent vector to the fiber at given model point More...
 
Vector dir (real ab) const
 normalized tangent vector to the fiber at given abscissa from the origin
 
Vector dir (real ab, FiberEnd from) const
 normalized tangent vector to the fiber at given abscissa from given reference
 
Vector dirEnd (FiberEnd which) const
 normalized tangent vector to the fiber at given end
 
real projectedForceOnEnd (FiberEnd which) const
 dot-product (force/km on the end of the Fiber).(direction of Fiber growth) More...
 
void segmentation (real c)
 set desired segmentation (the actual segmentation might be different)
 
real segmentation () const
 the current segment length (distance between successive model-points)
 
real segmentationCub () const
 returns segmentation() ^ 3
 
void resegment (unsigned int nb_points)
 recalculate fiber to have nb_points model points More...
 
void adjustSegmentation ()
 set the number of points to minimize abs( fnCut - fnCutWished ) More...
 
void reshape ()
 re-establish the distance between successive model-points
 
void getPoints (const real *x)
 set position
 
void minMaxSegments (real &, real &) const
 calculate the minimum and maximum segment length More...
 
void infoSegments (real &, real &) const
 calculate average and variance of the segment length More...
 
real minCosinus () const
 the cosine of the maximum segment angle: indicate the errors due to curvature
 
unsigned nbKinks (real threshold=0) const
 number of joints at which ( cosine(angle) < threshold ) More...
 
void join (FiberNaked const *fib)
 merge two fibers by joining the PLUS_END of fib with the MINUS_END of this More...
 
void growM (real dlen)
 increase/decrease length of Fiber by dlen, at the MINUS_END More...
 
void addSegmentM ()
 add a segment of length segmentation() at the MINUS_END More...
 
void cutM (real dlen)
 remove a piece of length dlen >= 0 at the MINUS_END More...
 
void growP (real dlen)
 increase/decrease length of Fiber by dlen, at the PLUS_END More...
 
void addSegmentP ()
 add a segment of length segmentation() at the MINUS_END More...
 
void cutP (real dlen)
 remove a piece of length dlen >= 0 at the PLUS_END More...
 
void setLength (real len, FiberEnd ref)
 adjust length without changing the position of ref
 
void truncateM (unsigned int p)
 Remove all model points in [ 0, P-1 ], keep [ P, nbPoints() ].
 
void truncateP (unsigned int p)
 Keep model points [ 0, p ], remove other points.
 
void write (OutputWrapper &) const
 write to OutputWrapper
 
void read (InputWrapper &, Simul &)
 read from InputWrapper More...
 
- Public Member Functions inherited from PointSet
 PointSet ()
 Constructor.
 
 PointSet (const PointSet &)
 Copy constructor.
 
PointSetoperator= (const PointSet &)
 Assignement operator.
 
virtual ~PointSet ()
 Destructor.
 
virtual unsigned int allocatePoints (unsigned int nbp)
 allocate memory to store 'nbp' points More...
 
virtual void deallocatePoints ()
 free memory allocated by allocatePoints()
 
unsigned int nbPoints () const
 Number of points.
 
unsigned int lastPoint () const
 Index of the last point = nbPoints - 1.
 
unsigned int nbSegments () const
 Number of segments = nbPoints - 1.
 
unsigned int lastSegment () const
 Index of the last segment = nbPoints - 2.
 
Vector posP (const unsigned p) const
 Position of point 'p' of the object.
 
real const * addr () const
 Address of point p.
 
real const * addrPoint (const unsigned p) const
 Address of point p.
 
void setPoint (unsigned p, Vector const &w)
 Set position of point p to w.
 
void nbPoints (const unsigned n)
 Set the number of points in the array.
 
unsigned int addPoint (Vector const &w)
 Add a point, returning the array index that was used.
 
void removePoint (unsigned int p)
 Remove a point from the array psPos, returns number of points remaining.
 
void clearPoints ()
 Remove all points.
 
void resetPoints ()
 Set all coordinates to zero (nicer for debug/testing)
 
void addNoise (real amount)
 Add random noise uniformly to all coordinate (used for testing purposes)
 
virtual void putPoints (real *) const
 copy current coordinates to argument
 
virtual void getForces (const real *ptr)
 replace current forces by the ones provided
 
Vector netForceP (const unsigned p) const
 Force on point p calculate by Brownian dynamics.
 
void movePoint (const unsigned int p, Vector const &w)
 Shift point at index p by vector w.
 
Vector diffPoints (const unsigned p) const
 Difference of two points = Q - P = vector PQ.
 
Vector diffPoints (const unsigned int p, const unsigned int q) const
 Difference of two points = Q - P = vector PQ.
 
Vector interpolatePoints (const unsigned int p, const unsigned int q, const real a) const
 Calculate intermediate position = P + a ( Q - P )
 
void calculateMomentum (real[], bool divide=false)
 calculate first momentum of point coordinates More...
 
void calculateMomentum (real[], real[], bool divide=false)
 calculate first and second momentum of point coordinates More...
 
virtual Vector position () const
 Position of center of gravity. More...
 
virtual bool translatable () const
 true if object accepts translations
 
virtual void translate (Vector const &)
 Translate object (moves all the points by w)
 
virtual bool rotatable () const
 true if object accepts translations
 
virtual void rotate (Rotation const &)
 Rotate object by given rotation.
 
virtual void foldPosition (const Modulo *)
 Modulo around the first point.
 
virtual void foldPositionG (const Modulo *)
 Call modulo around the center of gravity.
 
void write (OutputWrapper &) const
 Write to file.
 
void read (InputWrapper &, Simul &)
 Read from file.
 
- Public Member Functions inherited from Mecable
 Mecable ()
 The constructor resets the pointers.
 
virtual ~Mecable ()
 Destructor de-allocates memory.
 
virtual Vector posP (unsigned int P) const =0
 return position of point P
 
virtual void putPoints (real[]) const =0
 copy current coordinates to provided array
 
virtual void getPoints (const real[])=0
 replace current coordinates of points by values from the provided array
 
virtual Vector netForceP (unsigned int p) const =0
 return Force on point p calculated at previous step by Brownian dynamics
 
virtual void getForces (const real[])=0
 replace current forces by the ones provided
 
void matIndex (Matrix::index_type index)
 Store the index where coordinates are located in Meca.
 
Matrix::index_type matIndex () const
 Index in mB of the first point. the index in the vectors is DIM*matIndex() More...
 
bool useBlock () const
 Tell Meca to use preconditionning on this object or not.
 
void useBlock (bool b)
 change preconditionning flag
 
realallocateBlock (unsigned)
 Allocate a block of the requested size.
 
realblock () const
 return allocated block
 
virtual void setDragCoefficient ()=0
 Calculate the mobility coefficient.
 
virtual void prepareMecable ()=0
 prepare the Mecable to solve the mechanics in Meca::solve() More...
 
virtual void setInteractions (Meca &) const
 add the interactions (for example due to confinements)
 
- Public Member Functions inherited from Object
 Object ()
 constructor
 
virtual Tag tag () const =0
 an ASCII character identifying the ObjectSet corresponding to this object
 
virtual const Propertyproperty () const =0
 Property associated with the Object.
 
std::string reference () const
 concatenation of [ tag(), property()->index(), number() ] in plain ascii More...
 
void writeReference (OutputWrapper &) const
 write a reference that identifies the Object uniquely More...
 
void writeReference (OutputWrapper &, Tag tag) const
 write a reference, but using the provided Tag More...
 
int mark () const
 birth mark value
 
void mark (int m)
 set birth mark
 
int fleck () const
 fleck value (not stored in trajectory files)
 
void fleck (int f) const
 set fleck (the value is not stored in trajectory files)
 
Objectnext () const
 extends Node::next(), with a cast to preserve type
 
Objectprev () const
 extends Node::prev(), with a cast to preserve type
 
- Public Member Functions inherited from Node
 Node ()
 constructor set as unlinked
 
virtual ~Node ()
 destructor More...
 
bool linked () const
 true if Node is linked
 
Nodenext () const
 the next Node in the list, or zero if this is last
 
Nodeprev () const
 the previous Node in the list, or zero if this is first
 
NodeListlist () const
 the list where the object is linked, or zero
 
ObjectSetobjset () const
 return associated ObjectSet
 
- Public Member Functions inherited from Inventoried
 Inventoried ()
 initialize (name=0)
 
 ~Inventoried ()
 destructor
 
void number (Number n)
 change the serial number
 
Number number () const
 serial number : a integer identifier, unique within each class
 
- Public Member Functions inherited from Movable
 Movable ()
 constructor
 
virtual ~Movable ()
 destructor
 
virtual void setPosition (Vector const &)
 move object to specified position More...
 
virtual void rotateP (Rotation const &)
 rotate the object around its current position More...
 
- Public Member Functions inherited from Buddy
virtual ~Buddy ()
 upon destruction, goodbye is called for all buddies
 
void hello (Buddy *b)
 will make this and b mutual buddies
 
virtual void goodbye (Buddy *)
 this is called everytime a known buddy is destroyed
 
Buddybuddy (unsigned int ix) const
 return buddy at index ix
 
void buddy (Buddy *b, unsigned int ix)
 replace the buddy that may have been at index ix
 

Protected Member Functions

void storeDifferences ()
 calculate the average difference of successive model-point in rfDiff[] More...
 
- Protected Member Functions inherited from FiberNaked
virtual void updateRange ()=0
 callback for function that elongates or shorten the Fiber
 

Protected Attributes

real rfMobility
 mobility of the points More...
 
real rfRigidity
 rigidity scaling factor used in addRigidity()
 
- Protected Attributes inherited from PointSet
realpsPos
 psPos[] of size DIM*psAllocated contains DIM*psSize point-coordinates
 
real const * psFor
 psFor[] of size DIM*psAllocated contains DIM*psSize force-coordinates
 
Vector psCenter
 Center of gravity calculed in calculatePosition()
 
- Protected Attributes inherited from Node
NodenNext
 the next Node in the list
 
NodenPrev
 the previous Node in the list
 
- Protected Attributes inherited from Inventoried
Number nNumber
 object identifier, unique within the class defined by tag()
 

Additional Inherited Members

- Static Public Member Functions inherited from PointSet
static Vector diffPoints (const real *src, const unsigned p)
 Difference of two points = P+1 - P.
 
- Static Public Member Functions inherited from Object
static std::string strReference (char, int, Number, int)
 build a string reference by concatenating (tag, property_index, number, mark) More...
 
static void readReference (InputWrapper &, int &, Number &, int &, char pretag)
 read a reference (property_index, number, mark) from input More...
 
static void writeNullReference (OutputWrapper &)
 write a reference that does not refer to any Object
 
- Static Public Member Functions inherited from Movable
static Vector readPrimitive (std::istream &, const Space *)
 read a position specified with primitives, such as 'circle 5', etc. More...
 
static Vector readPosition (std::istream &, const Space *)
 read a position in space More...
 
static Vector readDirection (std::istream &, const Vector &, const Space *)
 read an orientation, and return a normalized vector More...
 
static Rotation readRotation (std::istream &, const Vector &, const Space *)
 read a rotation specified in is, at position pos More...
 
- Static Public Attributes inherited from Object
static const Tag TAG = 'v'
 Object::TAG = 'v' represents the 'void' pointer.
 

Member Function Documentation

real addBrownianForces ( real rhs,
real  sc 
) const
virtual

The argument should be: sc = kT / dt;

Reimplemented from Mecable.

void addRigidity ( const real X,
real Y 
) const
virtual

calculate the second-differential of points, scale by the rigidity term, and add to vector Y

Reimplemented from Mecable.

void projectForces ( const real X,
real Y,
real  s,
real work 
) const

work should be of size nbSegments() at least

void setSpeedsFromForces ( const real X,
real Y,
real  sc,
bool  rhs 
) const
virtual

If ( rhs != 0 ), then the local array rfLag[] is used, thus saving the Lagrange multiplier associated with the constraints for later use.

Implements Mecable.

void storeDifferences ( )
protected

Calculate the normalized difference between successive model point of the fiber:

for ( int n = 0; n < DIM*lastPoint(); ++n )
rfDiff[n] = ( psPos[n+DIM] - psPos[n] ) / segmentation();

Member Data Documentation

real rfMobility
protected

The entire Fiber's mobility is rfMobility/nbPoints()